package com.taomeishu.mailcrazy.checkers;

import com.taomeishu.mailcrazy.AbstractMailExistChecker;
import com.taomeishu.mailcrazy.checkers.sohu.SohuResultParser;
import com.taomeishu.mailcrazy.parser.ResultParser;
import com.taomeishu.mailcrazy.util.RandomUtil;

public class SohuMailExistChecker extends AbstractMailExistChecker {

	private String baseUrl = "http://passport.sohu.com/jsonajax/checkusername.action?shortname=";
	
	private SohuResultParser sohuResultParser = new SohuResultParser();
	
	@Override
	protected String makeRequestUrl(String username, String domainName) {
		return baseUrl + username + "&domain=" + domainName + "&appid=1000&_t=" + RandomUtil.getRandomDouble() + "&mobileReg=false";
	}

	@Override
	protected boolean usePostMethod() {
		return false;
	}

	@Override
	protected ResultParser getResultParser() {
		return sohuResultParser;
	}

	@Override
	protected String getReferer() {
		return "http://passport.sohu.com/web/dispatchAction.action?appid=1000&ru=http://mail.sohu.com/reg/signup_success.jsp";
	}

}
